package com.gosophia.accountManagement.action;

import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gosophia.commons.web.action.BaseAjaxAction;
import com.gosophia.userManagement.dto.UserAccountDTO;
import com.gosophia.userManagement.ws.UserManagementWebService;

/**
 * 获取账号列表action
 * @author mayue
 *
 */
@Controller("GetUserAccountListAction")
@Scope("prototype")
public class GetUserAccountListAction extends BaseAjaxAction<UserAccountDTO>{
     
    private static final long serialVersionUID = 1L;
    
    @Autowired
    private UserManagementWebService userManagementWebService;
    
    @Override
    public String _execute() throws Exception {
        if(searchString!=null && !"".equals(searchString)){
            searchString = searchString.trim();
        }
        page = userManagementWebService.findUserAccountsByPageSimple(searchString, orderConditions, page);
        
        if(page.getResult().size()==0){
            super.getRequestResult().setRsltCode("1");
        }else{
            super.getRequestResult().setRsltCode("0");
        }
        return SUCCESS;
    }

    @Override
    public UserAccountDTO getDetailData() {
        return null;
    }

    
}
